From: Federico Mena Quintero Date: Sat, 29 Dec 2018 18:32:08 +0000 (-0600) Subject: Morphology needs positive radii even after the transformation X-Git-Tag: archive/raspbian/2.44.10-2.1+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=079c13277de903f6eb5c722b2eef6ef44fcdff10;p=librsvg.git Morphology needs positive radii even after the transformation This is the same pattern as in gaussian_blur.rs; the paffine transformation can leave us with negative radii, so take their absolute value after the transformation. This fixes assertion error (crashing) when nagative r takes place. Forwarded: https://gitlab.gnome.org/GNOME/librsvg/issues/395 Applied-Upstream: https://gitlab.gnome.org/GNOME/librsvg/commit/4ef7f198fceb8fb4a544f4768174af5b11fc9bcc Bug-Debian: https://bugs.debian.org/927886 Signed-off-by: Boyuan Yang Gbp-Pq: Name keep-positive-radii.patch --- diff --git a/rsvg_internals/src/filters/morphology.rs b/rsvg_internals/src/filters/morphology.rs index 60fbcef..7de1a0d 100644 --- a/rsvg_internals/src/filters/morphology.rs +++ b/rsvg_internals/src/filters/morphology.rs @@ -95,6 +95,10 @@ impl Filter for Morphology { let (rx, ry) = self.radius.get(); let (rx, ry) = ctx.paffine().transform_distance(rx, ry); + // The radii can become negative here due to the transform. + let rx = rx.abs(); + let ry = ry.abs(); + let operator = self.operator.get(); let mut output_surface = ImageSurface::create(